|
Technical Q&AJava 01 - Simulated Click on AWT Button (Updated 3-February-1999)Q: How do I programmatically make my
A: This is typically desired when implementing default buttons and giving feedback that the default button action was performed when the Enter or Return key was pressed. There are other instances where this makes good sense from a user interface standpoint. The Macintosh Runtime for Java (MRJ) has provisions for this behavior built in. To get this behavior you need to pass a key-pressed event to the target button. Here is an example of how this could be achieved:
-- Levi Brown Worldwide Developer Technical Support Technical Q&As | Contents Next Question To contact us, please use the Contact Us page. |